home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / autose1g / frmselec.frm < prev    next >
Text File  |  1999-06-24  |  8KB  |  307 lines

  1. VERSION 5.00
  2. Object = "{D2D9B7C1-7650-11D1-9481-00A0247B7657}#1.0#0"; "ZLIBOCX2.DLL"
  3. Begin VB.Form frmSelectGame 
  4.    BackColor       =   &H00000000&
  5.    BorderStyle     =   0  'None
  6.    Caption         =   "Form1"
  7.    ClientHeight    =   5835
  8.    ClientLeft      =   555
  9.    ClientTop       =   1275
  10.    ClientWidth     =   9045
  11.    LinkTopic       =   "Form1"
  12.    MaxButton       =   0   'False
  13.    MinButton       =   0   'False
  14.    PaletteMode     =   1  'UseZOrder
  15.    ScaleHeight     =   5835
  16.    ScaleWidth      =   9045
  17.    ShowInTaskbar   =   0   'False
  18.    Begin ZLIBOCX2LibCtl.zlibIF zlibUnzipper 
  19.       Height          =   330
  20.       Left            =   1035
  21.       OleObjectBlob   =   "frmSelectGame.frx":0000
  22.       TabIndex        =   10
  23.       Top             =   4680
  24.       Visible         =   0   'False
  25.       Width           =   1815
  26.    End
  27.    Begin VB.CommandButton cmdCancel 
  28.       Caption         =   "&Cancel"
  29.       Height          =   330
  30.       Left            =   4185
  31.       TabIndex        =   9
  32.       Top             =   3900
  33.       Width           =   1200
  34.    End
  35.    Begin VB.CommandButton cmdStart 
  36.       Caption         =   "&OK"
  37.       Height          =   330
  38.       Left            =   2790
  39.       TabIndex        =   8
  40.       Top             =   3900
  41.       Width           =   1200
  42.    End
  43.    Begin VB.DirListBox dirDir1 
  44.       BackColor       =   &H00000000&
  45.       BeginProperty Font 
  46.          Name            =   "MS Sans Serif"
  47.          Size            =   8.25
  48.          Charset         =   0
  49.          Weight          =   700
  50.          Underline       =   0   'False
  51.          Italic          =   0   'False
  52.          Strikethrough   =   0   'False
  53.       EndProperty
  54.       ForeColor       =   &H0000FF00&
  55.       Height          =   1890
  56.       Left            =   3915
  57.       TabIndex        =   3
  58.       Top             =   1305
  59.       Width           =   2625
  60.    End
  61.    Begin VB.FileListBox filFile1 
  62.       BackColor       =   &H00000000&
  63.       BeginProperty Font 
  64.          Name            =   "MS Sans Serif"
  65.          Size            =   8.25
  66.          Charset         =   0
  67.          Weight          =   700
  68.          Underline       =   0   'False
  69.          Italic          =   0   'False
  70.          Strikethrough   =   0   'False
  71.       EndProperty
  72.       ForeColor       =   &H0000FF00&
  73.       Height          =   2235
  74.       Left            =   1800
  75.       TabIndex        =   2
  76.       Top             =   1305
  77.       Width           =   1965
  78.    End
  79.    Begin VB.DriveListBox drvDrive1 
  80.       BackColor       =   &H00000000&
  81.       BeginProperty Font 
  82.          Name            =   "MS Sans Serif"
  83.          Size            =   8.25
  84.          Charset         =   0
  85.          Weight          =   700
  86.          Underline       =   0   'False
  87.          Italic          =   0   'False
  88.          Strikethrough   =   0   'False
  89.       EndProperty
  90.       ForeColor       =   &H0000FF00&
  91.       Height          =   315
  92.       Left            =   3915
  93.       TabIndex        =   1
  94.       Top             =   3240
  95.       Width           =   2655
  96.    End
  97.    Begin VB.TextBox txtFileName 
  98.       BackColor       =   &H00000000&
  99.       ForeColor       =   &H0000FF00&
  100.       Height          =   300
  101.       Left            =   1800
  102.       TabIndex        =   0
  103.       Top             =   945
  104.       Width           =   1935
  105.    End
  106.    Begin VB.Label Label1 
  107.       BackColor       =   &H00000000&
  108.       Caption         =   "LOAD GAME"
  109.       BeginProperty Font 
  110.          Name            =   "MS Sans Serif"
  111.          Size            =   13.5
  112.          Charset         =   0
  113.          Weight          =   700
  114.          Underline       =   0   'False
  115.          Italic          =   0   'False
  116.          Strikethrough   =   0   'False
  117.       EndProperty
  118.       ForeColor       =   &H0000FF00&
  119.       Height          =   360
  120.       Left            =   3300
  121.       TabIndex        =   7
  122.       Top             =   135
  123.       Width           =   1950
  124.    End
  125.    Begin VB.Label lblDirName2 
  126.       BackColor       =   &H00000000&
  127.       Caption         =   "Directory:"
  128.       BeginProperty Font 
  129.          Name            =   "MS Sans Serif"
  130.          Size            =   9.75
  131.          Charset         =   0
  132.          Weight          =   700
  133.          Underline       =   0   'False
  134.          Italic          =   0   'False
  135.          Strikethrough   =   0   'False
  136.       EndProperty
  137.       ForeColor       =   &H0000FF00&
  138.       Height          =   225
  139.       Left            =   3960
  140.       TabIndex        =   6
  141.       Top             =   675
  142.       Width           =   1095
  143.    End
  144.    Begin VB.Label lblDirName 
  145.       BackColor       =   &H00000000&
  146.       ForeColor       =   &H0000FF00&
  147.       Height          =   285
  148.       Left            =   3945
  149.       TabIndex        =   5
  150.       Top             =   945
  151.       Width           =   3960
  152.    End
  153.    Begin VB.Label lblFileName 
  154.       BackColor       =   &H00000000&
  155.       Caption         =   "File Name:"
  156.       BeginProperty Font 
  157.          Name            =   "MS Sans Serif"
  158.          Size            =   9.75
  159.          Charset         =   0
  160.          Weight          =   700
  161.          Underline       =   0   'False
  162.          Italic          =   0   'False
  163.          Strikethrough   =   0   'False
  164.       EndProperty
  165.       ForeColor       =   &H0000FF00&
  166.       Height          =   225
  167.       Left            =   1800
  168.       TabIndex        =   4
  169.       Top             =   675
  170.       Width           =   1290
  171.    End
  172. End
  173. Attribute VB_Name = "frmSelectGame"
  174. Attribute VB_GlobalNameSpace = False
  175. Attribute VB_Creatable = False
  176. Attribute VB_PredeclaredId = True
  177. Attribute VB_Exposed = False
  178. Option Explicit
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186. Private Sub cmdCancel_Click()
  187. 'return to cover form - prevent game crashing
  188. 'when there is no game to load
  189. LoadCancelled = True
  190. Unload Me
  191.  
  192.  
  193. End Sub
  194.  
  195.  
  196. Private Sub cmdStart_Click()
  197. If txtFileName = "" Then
  198.     'no game selected
  199.     PlaySoundEffect "Quiet"
  200.     MsgBox "Please select a game to load"
  201.     Exit Sub
  202. Else
  203.     'decompress selected saved game file
  204.     Dim Path As String
  205.     Path = dirDir1.Path
  206.     
  207.     If Right(Path, 1) <> "\" Then
  208.         Path = Path + "\"
  209.     End If
  210.        
  211.     zlibUnzipper.InputFileName = Path + txtFileName.Text
  212.     zlibUnzipper.OutputFileName = App.Path + "\gameinfo.txt"
  213.     zlibUnzipper.Decompress
  214.     GameNumber = Val(Mid$(txtFileName.Text, 2, 1))
  215.     
  216.     Unload Me  '***program returns to frmCover to read big file, then loads frmGameScreen
  217.     
  218. End If
  219.  
  220. End Sub
  221.  
  222. Private Sub dirDir1_Change()
  223. 'update file list box with new directory
  224. filFile1.Path = dirDir1.Path
  225.  
  226. 'update dir label
  227. lblDirName.Caption = dirDir1.Path
  228.  
  229. End Sub
  230.  
  231. Private Sub drvDrive1_Change()
  232. On Error GoTo DriveError
  233.  
  234. 'change path of dir list box to new drive
  235. dirDir1.Path = drvDrive1.Drive
  236. Exit Sub
  237.  
  238. DriveError:
  239. PlaySoundEffect "Warning"
  240. MsgBox "Drive Error", , " "
  241.  
  242. 'restore the original drive
  243. drvDrive1.Drive = dirDir1.Path
  244. Exit Sub
  245.  
  246. End Sub
  247.  
  248. Private Sub filFile1_Click()
  249. txtFileName.Text = filFile1.Filename
  250.  
  251. End Sub
  252.  
  253. Private Sub filFile1_DblClick()
  254. txtFileName.Text = filFile1.Filename
  255. cmdStart_Click
  256.  
  257. End Sub
  258.  
  259.  
  260. Private Sub Form_Activate()
  261. Randomize
  262. 'draw white stars on the screen
  263.     Dim a, X, Y
  264.     For a = 1 To 400
  265.         X = Int(Rnd * Me.ScaleWidth)
  266.         Y = Int(Rnd * Me.ScaleHeight)
  267.         Me.PSet (X, Y), vbWhite
  268.     Next a
  269.     
  270.     'draw dark grey stars
  271.     Dim grey
  272.     grey = &H808080
  273.     For a = 1 To 400
  274.         X = Int(Rnd * Me.ScaleWidth)
  275.         Y = Int(Rnd * Me.ScaleHeight)
  276.         Me.PSet (X, Y), grey
  277.     Next a
  278.     
  279.     'draw blue stars
  280.     Dim blue
  281.     blue = &H800000
  282.     For a = 1 To 200
  283.        X = Int(Rnd * Me.ScaleWidth)
  284.        Y = Int(Rnd * Me.ScaleHeight)
  285.        Me.PSet (X, Y), blue
  286.     Next a
  287.  
  288. End Sub
  289.  
  290.  
  291.  
  292.  
  293.  
  294.  
  295. Private Sub Form_Load()
  296. 'set up drives, set to look only for
  297. 'compressed game files ending in .zlb
  298. drvDrive1.Drive = App.Path
  299. dirDir1.Path = App.Path
  300. filFile1.Pattern = "*.zlb"
  301.  
  302.  
  303.  
  304. End Sub
  305.  
  306.  
  307.